﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GmepModelInterface.h"
#include "GbmpDefines.h"
#include "IMepGenericElement.h"
#include "GbmpQuickCast.h"
namespace gcmp
{
    class UniIdentity;
    class IDocument;
}
namespace gmep
{
    class IUnitConverter;
    enum class DigitGroupingType;

    class GMEP_MODEL_INTERFACE_EXPORT IUnitConverterManager:public gcmp::IExternalObject
    {
        DEFINE_CAST_DERIVED(gmep::IUnitConverterManager, gcmp::IExternalObject);

    public:
        IUnitConverterManager() {}
        virtual ~IUnitConverterManager() {};
        static IUnitConverterManager* Get(const gcmp::IDocument *pDocument);
        static IUnitConverterManager *Create(gcmp::IDocument* pDocument);

    public:
        virtual bool SetDigitGroupingType(DigitGroupingType digitGroupingType) = 0;
        virtual DigitGroupingType GetDigitGroupingType() const = 0;
        virtual bool SetIsInPropertyPallet(bool isInPropertyPallet) = 0;
        virtual bool GetIsInPropertyPallet()const = 0;
    public:
        virtual IUnitConverter* GetUnitConverterFW(const gcmp::UniIdentity& uid) = 0;
        virtual const IUnitConverter* GetUnitConverter(const gcmp::UniIdentity& uid) const = 0;
        virtual bool HasUnitConverter(const gcmp::UniIdentity &uid) const = 0;
        virtual IUnitConverter* CreateUnitConerter(const gcmp::UniIdentity& uid) = 0;
        virtual gcmp::OwnerPtr<IUnitConverter> CreateUnitConerterIndependent(const gcmp::UniIdentity& uid) = 0;
        virtual bool RemoveUnitConverter(const gcmp::UniIdentity& uid) = 0;

    };
}